<?php
session_start();
include_once("function_right.php");
if(!JudgeUserRight()) return FALSE;
?>

<?php
include_once "function_obj_ip.php";

$in_array['Name'] = base64_encode($_POST['objname']);
$in_array['IpType'] = $_POST['selectIP'];

if ($in_array['IpType'] == "0")
{
	$in_array['Ip1'] = $_POST['SIP'];
	$in_array['Ip2'] = $_POST['EIP'];
	$in_array['NetMask'] = "";
}

if ($in_array['IpType'] == "1")
{
	$in_array['Ip1'] = $_POST['NIP'];
	$in_array['NetMask'] = $_POST['MASK'];
	$in_array['Ip2'] = "";
}
if ($in_array['IpType'] == "2")
{
	$in_array['Ip1'] = $_POST['IPadd'];
	$in_array['Ip2'] = "";
	$in_array['NetMask'] = "255.255.255.255";
}

AppendXmlIpObject($in_array);

include "function_misc_log.php";
$in_array['Name'] = "'". ($in_array['Name']). "'";
logger("Add", $in_array,"Object_Ip");

include "function_web_misc.php";
PrintSuccessPageAndJump('obj_ip_object_list.php');

//echo("<meta http-equiv='refresh'content=0;URL='obj_ip_object_list.php'>");
?>
